home *** CD-ROM | disk | FTP | other *** search
/ Dynamic HTML Construction Kit / Dynamic HTML Construction Kit.iso / source_code / dhtmlunl / dhtml.exe / CD Content / Chap15 / dun15_10.txt < prev    next >
Encoding:
Text File  |  1997-12-18  |  2.4 KB  |  78 lines

  1. <HTML>
  2. <HEAD>
  3.   <TITLE>Exposing Style Sheets in Communicator 4.0</TITLE>
  4.  
  5.   <STYLE>
  6.     BODY             { background-color: white; font-size: 10pt; }
  7.     FONT             { font-family: arial, helvetica, sans-serif; }
  8.     FONT.pageTitle   { font-size: 18pt; }
  9.     .layer           { background-color: yellow; }
  10.     #arrow           { padding-right: 10px; }
  11.     #banner          { position: absolute; left: 72; top: 8; }
  12.   </STYLE>
  13. </HEAD>
  14.  
  15. <BODY>
  16.   <BLOCKQUOTE>
  17.  
  18.   <IMG ID=arrow SRC="arrow.gif">
  19.  
  20.   <DIV ID=banner CLASS=layer STYLE="color: blue;">
  21.     <FONT CLASS=pageTitle>
  22.       Exposing Style Sheets in Communicator 4.0
  23.     </FONT>
  24.   </DIV>
  25.  
  26.   <P>Each page element with the <TT>ID</TT> attribute reflects a
  27.   style object into the <TT>ids</TT> array that represents the
  28.   styles applied to that page element.  The following style has
  29.   been applied to the <TT>arrow</TT> element:</P>
  30.  
  31.   <BLOCKQUOTE>
  32.   <SCRIPT>
  33.     document.writeln("<B>align:</B> ");
  34.     document.writeln(document.ids.arrow.paddingRight);
  35.     document.writeln("<BR>");
  36.   </SCRIPT>
  37.   </BLOCKQUOTE>
  38.  
  39.   <P>Each tag reflects a style object into the <TT>tags</TT> array
  40.   that represents the styles applied to that tag.  The following
  41.   style has been applied to the <TT>FONT</TT> tag:</P>
  42.  
  43.   <BLOCKQUOTE>
  44.   <SCRIPT>
  45.     document.writeln("<B>font-family:</B> ");
  46.     document.writeln(document.tags.FONT.fontFamily);
  47.     document.writeln("<BR>");
  48.   </SCRIPT>
  49.   </BLOCKQUOTE>
  50.  
  51.   <P>Each class reflects an array of style objects into the
  52.   <TT>classes</TT> array that represents the styles applied to
  53.   all tags of that class as well as the class in general.  The
  54.   following style has been applied to the <TT>layer</TT> class:</P>
  55.  
  56.   <BLOCKQUOTE>
  57.   <SCRIPT>
  58.     document.writeln("<B>backgroundColor:</B> ");
  59.     document.writeln(document.classes.layer.all.backgroundColor);
  60.     document.writeln("<BR>");
  61.   </SCRIPT>
  62.   </BLOCKQUOTE>
  63.  
  64.   <P>Similarly, the following style has been applied only to elements
  65.   whose class is <TT>pageTitle</TT> and whose tag is <TT>FONT</TT>:</P>
  66.  
  67.   <BLOCKQUOTE>
  68.   <SCRIPT>
  69.     document.writeln("<B>fontSize:</B> ");
  70.     document.writeln(document.classes.pageTitle.FONT.fontSize);
  71.     document.writeln("<BR>");
  72.   </SCRIPT>
  73.   </BLOCKQUOTE>
  74.  
  75.   </BLOCKQUOTE>
  76. </BODY>
  77. </HTML>
  78.